﻿@{
    ViewData["Title"] = Texts.Forms.Membership.Login.FormTitle;
    ViewData["PageId"] = "Login";
    ViewData["BodyClass"] = "login-page";
    Layout = MVC.Views.Shared._LayoutNoNavigation;
}

@section Head {
    <link rel="stylesheet" href="~/Content/iCheck/square/blue.css" />
    <script src="~/Scripts/jquery.icheck.min.js"></script>
}

<script id="Template_Membership_LoginPanel" type="text/template">
    <div class="s-Form">
        <form id="~_Form" action="">            
            <div id="~_PropertyGrid"></div>
            <div class="row">
                <div class="col-xs-7">
                    <div class="checkbox icheck">
                        <label>
                            <input type="checkbox"> @Texts.Forms.Membership.Login.RememberMe
                        </label>
                    </div>
                </div>
                <div class="col-xs-5">
                    <button id="~_LoginButton" type="submit" class="btn btn-primary btn-block btn-flat">@Texts.Forms.Membership.Login.SignInButton</button>
                </div>
            </div>
        </form>
    </div>
</script>

@if (DataMigrations.SkippedMigrations)
{
<div class="alert alert-error alert-dismissible">
    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
    <h4><i class="icon fa fa-warning"></i> Warning!</h4>
    Serene skipped running migrations to avoid modifying an arbitrary database.
    If you'd like to run migrations on this database, remove the safety check 
    in SiteInitialization.RunMigrations method.
</div>
}

@if (ViewData["Activated"] != null)
{
<div class="alert alert-info alert-dismissible">
    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
    <h4><i class="icon fa fa-info"></i>@LocalText.Get("Dialogs.InformationTitle")</h4>
    @Texts.Forms.Membership.SignUp.ActivationCompleteMessage
</div>
}

<div class="login-box">
    <div class="login-logo">
        @Texts.Navigation.SiteTitle
    </div>
    <div class="login-box-body">
        <p class="login-box-msg">@Texts.Forms.Membership.Login.FormTitle</p>
        <div id="LoginPanel">
        </div>
        <div class="social-auth-links text-center">
            <p>- @Texts.Forms.Membership.Login.OR -</p>
            <a href="#" class="btn btn-block btn-social btn-facebook btn-flat">
                <i class="fa fa-facebook"></i> @Texts.Forms.Membership.Login.FacebookButton
            </a>
            <a href="#" class="btn btn-block btn-social btn-google btn-flat">
                <i class="fa fa-google-plus"></i> @Texts.Forms.Membership.Login.GoogleButton
            </a>
        </div>
        <a href="@Url.Content("~/Account/ForgotPassword")">@Texts.Forms.Membership.Login.ForgotPassword</a><br>
        <a href="@Url.Content("~/Account/SignUp")" class="text-center">@Texts.Forms.Membership.Login.SignUpButton</a>
    </div>
</div>

<script type="text/javascript">
jQuery(function() {
    new Serene.Membership.LoginPanel($('#LoginPanel')).init();
    $('.field.Username,.field.Password').addClass("has-icon");
    $('.field.Username input').after("<span class='glyphicon glyphicon-user form-control-feedback'></span>");
    $('.field.Password input').after("<span class='glyphicon glyphicon-lock form-control-feedback'></span>");
    $('input').iCheck({
        checkboxClass: 'icheckbox_square-blue',
        radioClass: 'iradio_square-blue',
        increaseArea: '20%'
    });
@if (ViewData["Activated"] != null)
{
    <text>
    $(function() { 
        $('#Serene_Membership_LoginPanel0_Username').val(@Html.Raw(Serenity.JSON.Stringify(ViewData["Activated"])));
        $('#Serene_Membership_LoginPanel0_Password').focus();
    });
    </text>
}
});
</script>